<?php

require_once "core/application/models/bans/mbans4.php";

class Mbans5 extends Mbans4 {

    private $_query;

    protected function isBanned($ip) {
        /**
         *  проверяем, не забанен ли уже такой IP адрес
         * @param mixed $ip
         */
        DB::getInstance()->openConnectionToLS();
        $this->_query = "SELECT `mask` FROM `banned_ip` WHERE `mask` = '$ip' ";
        if (mysql_num_rows(DB::getInstance()->sql($this->_query))) {
            return true;
            DB::getInstance()->closeConnection();
            unset($this->_query);
        } else {
            return false;
            DB::getInstance()->closeConnection();
            unset($this->_query);
        }
    }

}

?>
